package com.vfmall.dto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@ApiModel(description = "新增员工数据模型")
public class EmployeeDTO implements Serializable {
    private Long id;
    @NotBlank(message = "姓名不能为空")
    private String name;

    @NotBlank(message = "用户名不能为空")
    private String username;

    @NotBlank(message = "性别不能为空")
    @Pattern(regexp = "[012]", message = "性别格式错误（0=未知，1=男，2=女）")
    private String sex;

    @NotBlank(message = "手机不能为空")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    private String phone;

    @NotBlank(message = "身份证号不能为空")
    @Pattern(regexp = "^\\d{17}[\\dXx]$", message = "身份证号格式错误")
    private String idNumber;
}